// 2013-8-1上午11:52:38  net.betou.trade.entity.main.base.BaseUser.java

package net.betou.trade.entity.main.base;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;

import net.betou.trade.entity.main.AgentAndAdmins;
import net.betou.trade.entity.main.Picture;
import net.betou.trade.entity.main.User;
import net.betou.trade.entity.main.UserExt;
import net.betou.trade.entity.main.UserGroup;

/**
 * 用户 
 * @author 叶装装
 */
public abstract class BaseUser implements Serializable{

	private Integer id;
	private String username;
	private String password;
	private String salt;
	private String email;
	private String mobile;
	private Date regDate;       // 注册时间
	private String regIp;         // 注册IP
	
	private Date loginDate;   // 登录的信息
 	private String loginIp;     // 登录的IP
	private Integer loginCount;  // 登录的次数
	
	private Date expireDate;  // 过期时间
	
	private String demoAccount;       // 模拟账号
	private String demoAccountPwd;
	private String firmAccount;        // 实盘账号
	private String firmAccountPwd;
	
	private Boolean disabled;
	
	private Boolean logon; // 是否登录
	
	// many to one
	private UserGroup group;
	private AgentAndAdmins admin;
	
	private Set< UserExt > exts;
	private Set< Picture > pics; // 图片列表
	
	
	private Byte status; // 状态
	
	public Integer getId( ) {
		return id;
	}



	public void setId( Integer id ) {
		this.id = id;
	}



	public String getUsername( ) {
		return username;
	}



	public void setUsername( String username ) {
		this.username = username;
	}



	public String getPassword( ) {
		return password;
	}



	public void setPassword( String password ) {
		this.password = password;
	}



	public String getSalt( ) {
		return salt;
	}



	public void setSalt( String salt ) {
		this.salt = salt;
	}



	public String getEmail( ) {
		return email;
	}



	public void setEmail( String email ) {
		this.email = email;
	}



	public String getMobile( ) {
		return mobile;
	}



	public void setMobile( String mobile ) {
		this.mobile = mobile;
	}



	public Date getRegDate( ) {
		return regDate;
	}



	public void setRegDate( Date regDate ) {
		this.regDate = regDate;
	}



	public String getRegIp( ) {
		return regIp;
	}



	public void setRegIp( String regIp ) {
		this.regIp = regIp;
	}



	public Date getLoginDate( ) {
		return loginDate;
	}



	public void setLoginDate( Date loginDate ) {
		this.loginDate = loginDate;
	}



	public String getLoginIp( ) {
		return loginIp;
	}



	public void setLoginIp( String loginIp ) {
		this.loginIp = loginIp;
	}



	public Integer getLoginCount( ) {
		return loginCount;
	}



	public void setLoginCount( Integer loginCount ) {
		this.loginCount = loginCount;
	}



	public Date getExpireDate( ) {
		return expireDate;
	}



	public void setExpireDate( Date expireDate ) {
		this.expireDate = expireDate;
	}



	public String getDemoAccount( ) {
		return demoAccount;
	}



	public void setDemoAccount( String demoAccount ) {
		this.demoAccount = demoAccount;
	}



	public String getDemoAccountPwd( ) {
		return demoAccountPwd;
	}



	public void setDemoAccountPwd( String demoAccountPwd ) {
		this.demoAccountPwd = demoAccountPwd;
	}



	public String getFirmAccount( ) {
		return firmAccount;
	}



	public void setFirmAccount( String firmAccount ) {
		this.firmAccount = firmAccount;
	}



	public String getFirmAccountPwd( ) {
		return firmAccountPwd;
	}



	public void setFirmAccountPwd( String firmAccountPwd ) {
		this.firmAccountPwd = firmAccountPwd;
	}



	public Boolean getDisabled( ) {
		return disabled;
	}



	public void setDisabled( Boolean disabled ) {
		this.disabled = disabled;
	}



	public UserGroup getGroup( ) {
		return group;
	}



	public void setGroup( UserGroup group ) {
		this.group = group;
	}



	public AgentAndAdmins getAdmin( ) {
		return admin;
	}



	public void setAdmin( AgentAndAdmins admin ) {
		this.admin = admin;
	}


	private int hashCode = Integer.MIN_VALUE;
	
	public boolean equals( Object obj ) {
		if( null == obj )
			return false;
		if( !( obj instanceof User ) )
			return false;
		else{
			User user = ( User ) obj;
			if( null == this.getId( ) || null == user.getId( ) )
				return false;
			else
				return( this.getId( ).equals( user.getId( ) ) );
		}
	}

	public int hashCode( ) {
		if( Integer.MIN_VALUE == this.hashCode ){
			if( null == this.getId( ) )
				return super.hashCode( );
			else{
				String hashStr = this.getClass( ).getName( ) + ":" + this.getId( ).hashCode( );
				this.hashCode = hashStr.hashCode( );
			}
		}
		return this.hashCode;
	}

	private static final long serialVersionUID = -3263403596091003L;

	public Set< UserExt > getExts( ) {
		return exts;
	}



	public void setExts( Set< UserExt > exts ) {
		this.exts = exts;
	}



	public Boolean getLogon( ) {
		return logon;
	}



	public void setLogon( Boolean logon ) {
		this.logon = logon;
	}



	public Set< Picture > getPics( ) {
		return pics;
	}

	public void setPics( Set< Picture > pics ) {
		this.pics = pics;
	}



	public Byte getStatus( ) {
		return status;
	}



	public void setStatus( Byte status ) {
		this.status = status;
	}
	
}
